[GIT-238] refactor: migrate types from apps/web to @plane/types#9203
[GIT-238] refactor: migrate types from apps/web to @plane/types#9203Rahulcheryala wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR consolidates scattered type definitions across the codebase into the centralized ChangesType Consolidation to Shared Package
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
apps/web/core/services/issue/issue_relation.service.ts (1)
8-11: ⚡ Quick winMerge the duplicate
@plane/typesimport.
TIssueRelationTypesis now imported from@plane/types(Line 11), duplicating the type import on Line 8. Consolidate them; the// helpersand// Plane-webcomments (Lines 9–10) are now stale.♻️ Proposed refactor
import { API_BASE_URL } from "`@plane/constants`"; -import type { TIssueRelation, TIssue } from "`@plane/types`"; -// helpers -// Plane-web -import type { TIssueRelationTypes } from "`@plane/types`"; +import type { TIssue, TIssueRelation, TIssueRelationTypes } from "`@plane/types`"; // services import { APIService } from "`@/services/api.service`";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/core/services/issue/issue_relation.service.ts` around lines 8 - 11, The import of types from "`@plane/types`" is duplicated; remove the extra import and consolidate TIssueRelation, TIssue, and TIssueRelationTypes into a single type import. Update the import statement at the top of issue_relation.service.ts to import { TIssueRelation, TIssue, TIssueRelationTypes } from "`@plane/types`" and delete the stale "// helpers" and "// Plane-web" comment lines so only one consolidated type import remains.apps/web/core/store/issue/issue-details/relation.store.ts (1)
11-16: ⚡ Quick winMerge the duplicate
@plane/typesimport.
TIssueRelationTypes(Line 16) comes from@plane/types, the same module as the type import on Line 11. Combine into one statement; the// Plane-webcomment on Line 14 no longer applies.♻️ Proposed refactor
-import type { TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue } from "`@plane/types`"; +import type { + TIssue, + TIssueRelation, + TIssueRelationIdMap, + TIssueRelationMap, + TIssueRelationTypes, +} from "`@plane/types`"; // components import type { TRelationObject } from "`@/components/issues/issue-detail-widgets/relations`"; -// Plane-web import { REVERSE_RELATIONS } from "`@/constants/gantt-chart`"; -import type { TIssueRelationTypes } from "`@plane/types`";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/core/store/issue/issue-details/relation.store.ts` around lines 11 - 16, The file has two separate imports from "`@plane/types`" (TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue and TIssueRelationTypes); merge these into a single import statement that includes TIssueRelationTypes alongside TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, and TIssue, remove the now-misplaced "// Plane-web" comment, and keep the other imports (TRelationObject and REVERSE_RELATIONS) unchanged so symbols like TRelationObject and REVERSE_RELATIONS continue to be imported from their original modules.apps/web/core/store/issue/issue-details/root.store.ts (1)
9-26: ⚡ Quick winAdd
TIssueRelationTypesto the existing@plane/typesimport block.The new Line 26 import duplicates the
@plane/typessource already imported in the block on Lines 9–18. Fold it into that block to avoid a duplicate import statement.♻️ Proposed refactor
import type { TIssue, TIssueAttachment, TIssueComment, TIssueCommentReaction, TIssueLink, TIssueReaction, + TIssueRelationTypes, TIssueServiceType, TWorkItemWidgets, } from "`@plane/types`"; // plane web store import { IssueActivityStore } from "`@/plane-web/store/issue/issue-details/activity.store`"; import type { IIssueActivityStore, IIssueActivityStoreActions, TActivityLoader, } from "`@/plane-web/store/issue/issue-details/activity.store`"; -import type { TIssueRelationTypes } from "`@plane/types`"; import type { IIssueRootStore } from "../root.store";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/core/store/issue/issue-details/root.store.ts` around lines 9 - 26, The file has a duplicate import from "`@plane/types`" for TIssueRelationTypes; update the first import block (which already imports TIssue, TIssueAttachment, TIssueComment, TIssueCommentReaction, TIssueLink, TIssueReaction, TIssueServiceType, TWorkItemWidgets) to also include TIssueRelationTypes and remove the separate import line for TIssueRelationTypes so there is only one consolidated import from "`@plane/types`" in root.store.ts (refer to the import block and the standalone TIssueRelationTypes import to locate the changes).apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx (1)
11-21: ⚡ Quick winConsolidate the duplicate
@plane/typestype imports.
TIssueRelationTypesis imported via a separateimport typefrom@plane/typeseven though other types are already imported from the same module; merge them into a singleimport typestatement (and keep the// Plane-webcomment scoped to Plane-web imports).♻️ Proposed refactor
-import type { TIssue, TIssueServiceType } from "`@plane/types`"; +import type { TIssue, TIssueRelationTypes, TIssueServiceType } from "`@plane/types`"; import { EIssueServiceType } from "`@plane/types`"; import { Collapsible } from "`@plane/ui`"; // components import { CreateUpdateIssueModal } from "`@/components/issues/issue-modal/modal`"; // hooks import { useIssueDetail } from "`@/hooks/store/use-issue-detail`"; // Plane-web import { CreateUpdateEpicModal } from "`@/plane-web/components/epics/epic-modal`"; import { useTimeLineRelationOptions } from "`@/plane-web/components/relations`"; -import type { TIssueRelationTypes } from "`@plane/types`";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx` around lines 11 - 21, Consolidate duplicate imports from "`@plane/types`" by merging the separate import for TIssueRelationTypes into the existing import that brings in TIssue and TIssueServiceType; keep EIssueServiceType as a value import (import { EIssueServiceType }) and use a single import type { TIssue, TIssueServiceType, TIssueRelationTypes } for types, and ensure the existing "// Plane-web" comment remains only above Plane-web imports like CreateUpdateEpicModal and useTimeLineRelationOptions to preserve grouping.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/types/src/issues/issue-property-values.ts`:
- Around line 7-8: Replace the overly-broad object types for
TIssuePropertyValues and TIssuePropertyValueErrors with keyed Record types so
consumers can index them safely; e.g. change export type TIssuePropertyValues =
object; and export type TIssuePropertyValueErrors = object; to something like
export type TIssuePropertyValues = Record<string, unknown>; and export type
TIssuePropertyValueErrors = Record<string, string | undefined>; (adjust the
value union to match actual value/error shapes used by IssueModalContext and
other consumers) so property access and indexing compile and remain type-safe.
---
Nitpick comments:
In `@apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx`:
- Around line 11-21: Consolidate duplicate imports from "`@plane/types`" by
merging the separate import for TIssueRelationTypes into the existing import
that brings in TIssue and TIssueServiceType; keep EIssueServiceType as a value
import (import { EIssueServiceType }) and use a single import type { TIssue,
TIssueServiceType, TIssueRelationTypes } for types, and ensure the existing "//
Plane-web" comment remains only above Plane-web imports like
CreateUpdateEpicModal and useTimeLineRelationOptions to preserve grouping.
In `@apps/web/core/services/issue/issue_relation.service.ts`:
- Around line 8-11: The import of types from "`@plane/types`" is duplicated;
remove the extra import and consolidate TIssueRelation, TIssue, and
TIssueRelationTypes into a single type import. Update the import statement at
the top of issue_relation.service.ts to import { TIssueRelation, TIssue,
TIssueRelationTypes } from "`@plane/types`" and delete the stale "// helpers" and
"// Plane-web" comment lines so only one consolidated type import remains.
In `@apps/web/core/store/issue/issue-details/relation.store.ts`:
- Around line 11-16: The file has two separate imports from "`@plane/types`"
(TIssueRelationIdMap, TIssueRelationMap, TIssueRelation, TIssue and
TIssueRelationTypes); merge these into a single import statement that includes
TIssueRelationTypes alongside TIssueRelationIdMap, TIssueRelationMap,
TIssueRelation, and TIssue, remove the now-misplaced "// Plane-web" comment, and
keep the other imports (TRelationObject and REVERSE_RELATIONS) unchanged so
symbols like TRelationObject and REVERSE_RELATIONS continue to be imported from
their original modules.
In `@apps/web/core/store/issue/issue-details/root.store.ts`:
- Around line 9-26: The file has a duplicate import from "`@plane/types`" for
TIssueRelationTypes; update the first import block (which already imports
TIssue, TIssueAttachment, TIssueComment, TIssueCommentReaction, TIssueLink,
TIssueReaction, TIssueServiceType, TWorkItemWidgets) to also include
TIssueRelationTypes and remove the separate import line for TIssueRelationTypes
so there is only one consolidated import from "`@plane/types`" in root.store.ts
(refer to the import block and the standalone TIssueRelationTypes import to
locate the changes).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 18d9a988-97cf-42aa-a2b9-75147a33af35
📒 Files selected for processing (40)
apps/web/app/(all)/[workspaceSlug]/(projects)/extended-project-sidebar.tsxapps/web/ce/components/breadcrumbs/project.tsxapps/web/ce/components/projects/create/root.tsxapps/web/ce/components/relations/index.tsxapps/web/ce/hooks/pages/use-pages-pane-extensions.tsapps/web/ce/types/index.tsapps/web/ce/types/issue-types/index.tsapps/web/ce/types/issue-types/issue-property-values.d.tsapps/web/ce/types/pages/pane-extensions.tsapps/web/ce/types/projects/index.tsapps/web/ce/types/projects/projects.tsapps/web/core/components/common/activity/activity-item.tsxapps/web/core/components/common/activity/helper.tsxapps/web/core/components/dropdowns/project/base.tsxapps/web/core/components/issues/filters.tsxapps/web/core/components/issues/issue-detail-widgets/relations/content.tsxapps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsxapps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsxapps/web/core/components/issues/issue-detail/relation-select.tsxapps/web/core/components/issues/issue-modal/context/issue-modal-context.tsxapps/web/core/components/issues/relations/issue-list-item.tsxapps/web/core/components/issues/relations/issue-list.tsxapps/web/core/components/navigation/customize-navigation-dialog.tsxapps/web/core/components/navigation/project-header-button.tsxapps/web/core/components/power-k/menus/projects.tsxapps/web/core/components/project/create-project-modal.tsxapps/web/core/components/project/create/common-attributes.tsxapps/web/core/components/workspace/sidebar/projects-list.tsxapps/web/core/constants/gantt-chart.tsapps/web/core/hooks/use-navigation-preferences.tsapps/web/core/services/issue/issue_relation.service.tsapps/web/core/services/project/project.service.tsapps/web/core/store/issue/issue-details/relation.store.tsapps/web/core/store/issue/issue-details/root.store.tsapps/web/core/store/project/project.store.tspackages/types/src/index.tspackages/types/src/issues/issue-property-values.tspackages/types/src/navigation-preferences.tspackages/types/src/project/activity.tspackages/types/src/project/index.ts
💤 Files with no reviewable changes (6)
- apps/web/ce/types/issue-types/issue-property-values.d.ts
- apps/web/ce/types/projects/index.ts
- apps/web/ce/types/projects/projects.ts
- apps/web/ce/types/index.ts
- apps/web/ce/types/issue-types/index.ts
- apps/web/ce/types/pages/pane-extensions.ts
Description
Consolidated types to @packages/types
Type of Change
Summary by CodeRabbit